package com.li.utilstest

import com.li.utilstest.statepage.FMEmptyState
import com.zy.multistatepage.MultiStateContainer
import com.zy.multistatepage.state.ErrorState
import com.zy.multistatepage.state.LoadingState
import com.zy.multistatepage.state.SuccessState

/**
 * @author : liyun
 * @ClassName: StatePageExpand
 * @Package com.li.utilstest
 * @Description:
 * @company: 深圳君南信息系统有限公司
 * @date 2021/7/17 17:08
 * @version v1.0
 */

fun MultiStateContainer.showEmpty(msg:String?,callBack: (FMEmptyState) -> Unit = {}){
    show<FMEmptyState>{
        it.setEmptyMsg(msg)
        callBack(it)
    }
}

fun MultiStateContainer.load(callBack: (LoadingState) -> Unit = {}){
    show<LoadingState>{ callBack(it)}
}

fun MultiStateContainer.showError(callBack: (ErrorState) -> Unit = {}){
    show<ErrorState>{ callBack(it)}
}

fun MultiStateContainer.success(callBack: (SuccessState) -> Unit = {}){
    show<SuccessState>{ callBack(it)}
}